package com.rtsapp.server.network.protocol.crypto.client;

/**
 * RSA连接握手证书
 */
public class ClientRSAHandshakeKey {

    // 客户端私钥
    // N factor in RSA, aslo called modulus.
    private String N_CLIENT;
    // e factor in RSA, aslo called public exponent.
    private String e_CLIENT;
    // d factor in RSA, aslo called private exponent
    private String d_CLIENT;


    // 服务器公钥
    // N factor in RSA, aslo called modulus.
    private final String N_SERVER;
    // e factor in RSA, aslo called public exponent.
    private final String e_SERVER;


    public ClientRSAHandshakeKey(String n_CLIENT, String e_CLIENT, String d_CLIENT, String n_SERVER, String e_SERVER) {
        this.N_CLIENT = n_CLIENT;
        this.e_CLIENT = e_CLIENT;
        this.d_CLIENT = d_CLIENT;

        this.N_SERVER = n_SERVER;
        this.e_SERVER = e_SERVER;
    }


    public static ClientRSAHandshakeKey newDemoKey() {

        // 客户端私钥
        String N_CLIENT = "90755611487566208138950675092879865387596685014726501531250157258482495478524769456222913843665634824684037468817980814231054856125127115894189385717148934026931120932481402379431731629550862846041784305274651476086892165805223719552575599962253392248079811268061946102234935422772131475340988882825043233323";
        String e_CLIENT = "65537";
        String d_CLIENT = "17790520481266507102264359414044396762660094486842415203197747383916331528947124726552875080482359744765793816651732601742929364124685415229452844016482477236658413327331659722342187036963943428678684677279032263501011143882814728160215380051287503219732737197808611144507720521201393129692996926599975297921";

        //服务器公钥
        String N_SERVER = "90755611487566208138950675092879865387596685014726501531250157258482495478524769456222913843665634824684037468817980814231054856125127115894189385717148934026931120932481402379431731629550862846041784305274651476086892165805223719552575599962253392248079811268061946102234935422772131475340988882825043233323";
        String e_SERVER = "65537";

        return new ClientRSAHandshakeKey(N_CLIENT, e_CLIENT, d_CLIENT, N_SERVER, e_SERVER );
    }

    public String getN_SERVER() {
        return N_SERVER;
    }

    public String getE_SERVER() {
        return e_SERVER;
    }

    public String getN_CLIENT() {
        return N_CLIENT;
    }

    public String getE_CLIENT() {
        return e_CLIENT;
    }

    public String getD_CLIENT() {
        return d_CLIENT;
    }
}
